package com.fr.cell.clipboard;

import com.fr.report.CellElement;
import com.fr.report.core.util.CellElementComparator;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class CellElementsClip
  implements Cloneable, Serializable
{
  private List cellElementList = new ArrayList();
  private int columnSpan = 0;
  private int rowSpan = 0;

  public CellElementsClip(int paramInt1, int paramInt2)
  {
    setColumnSpan(paramInt1);
    setRowSpan(paramInt2);
  }

  public void clearCellElemens()
  {
    this.cellElementList.clear();
  }

  public void addCellElement(CellElement paramCellElement)
  {
    this.cellElementList.add(paramCellElement);
  }

  public int getCellElementCount()
  {
    return this.cellElementList.size();
  }

  public CellElement getCellElement(int paramInt)
  {
    return ((CellElement)this.cellElementList.get(paramInt));
  }

  public int getColumnSpan()
  {
    return this.columnSpan;
  }

  public void setColumnSpan(int paramInt)
  {
    this.columnSpan = paramInt;
  }

  public int getRowSpan()
  {
    return this.rowSpan;
  }

  public void setRowSpan(int paramInt)
  {
    this.rowSpan = paramInt;
  }

  public void sortElementList()
  {
    Collections.sort(this.cellElementList, CellElementComparator.getRowFirstComparator());
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    CellElementsClip localCellElementsClip = (CellElementsClip)super.clone();
    ArrayList localArrayList = new ArrayList();
    for (int i = 0; i < this.cellElementList.size(); ++i)
      localArrayList.add(((CellElement)this.cellElementList.get(i)).clone());
    localCellElementsClip.cellElementList = localArrayList;
    return localCellElementsClip;
  }
}